# 1.封装函数，计算从1到某个数以内所有奇数的和并返回
def fn():
    num = int(input("请输入一个数字:"))
    sum = 0
    for i in range(1,num+1,2):
        sum += i
    return sum

nn = fn()
print(nn)

# 
def fn1(num):
    return sum(range(1,num + 1,2))
print(fn1(12))
